package com.deng.mapper;

import com.deng.pojo.Department;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @create 2020-12-24 15:15
 */
@Mapper
public interface DepartmentMapper {
    @Select("select `id`,`departmentName` from t_department")
    List<Department> getAllDepartments();

    @Select("select `id`,`departmentName` from t_department where id=#{id}")
    Department getDepartmentById(@RequestParam("id") Integer id);
}
